Repository navigation
fix(app-shell): an edit a Studio pillar holds unsent guards departure like a dirty pillar - #26839
Merged
Merged
Conversation
Claude-Session: https://claude.ai/code/session_01JQwxbZJiPgbGWj5B2jNkYx Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZJiPgbGWj5B2jNkYx Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01JQwxbZJiPgbGWj5B2jNkYx Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
Generated by Claude Code |
…n suites ResourceEditPage.discardDraftLabel-12690 and PackageFormDialog.validationTiming read studio-namespace rows in zh synchronously; since the namespace's zh catalogue loads on demand (objectstack#25922) they raced the fetch on main CI. Load it at module scope, as the other zh-reading suites do. Claude-Session: https://claude.ai/code/session_01JQwxbZJiPgbGWj5B2jNkYx Co-authored-by: Claude <noreply@anthropic.com>
This was referenced Oct 27, 2026
Contributor
Author
席位核对ACCEPT · seat 席位意见:一个共享守卫
Generated by Claude Code |
This was referenced Oct 27, 2026
This was referenced Oct 27, 2026
Closed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Requested by Warren · project thread
Fixes #26705
Clause-②: no
Metadata-protocol: none
维护者速读
StudioDesignSurface.tsx里的confirmDropUnsavedWork和unsavedPillarWork,然后三处左侧栏 onClick / onPick 的守卫行,最后StudioDesignSurface.heldDataLeave-26705.test.tsx。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/StudioDesignSurface.heldDataLeave-26705.test.tsx,预期 4 个测试全绿。What changes
Base
607d3bb1, thenorigin/main55b5042emerged in (no conflict; nothing it brought touches these files). Thend33bfcf7: the zh catalogue preload in two metadata-admin suites (test-only, scope widened by the seat, Claim 6452362760). One shared guard, read by every departure that drops a pillar's buffer:confirmDropUnsavedWork(unsaved, locale), a module function besideuseHeldEditReport: the one question (engine.edit.unsavedLeaveConfirm, the text Access already asks) ortruewhen nothing would be lost. Access's ownconfirmDiscardEditsnow calls it too, so the question has one spelling.heldEditmoves up besidepillarDirty, andunsavedPillarWork = pillarDirty || heldEdit !== nullreplacespillarDirtyinconfirmLeavePillar, thebeforeunloadeffect anduseRegisterUnsavedEdits. That covers the pillar links (the shell seam's link guard asks while registered), Home, the package switcher, the cross-pillar?surface=request, Create app, the shell's own departures and reload. Pillars already take their held report back on unmount, so a confirmed leave clears the guard.objHeld, the Automations flow rail onflowHeld, the Interfaces nav rail onleafHeld. Re-picking the open item (same object, same flow, an entry for the same leaf) drops nothing and asks nothing, mirroring Access's rail.Why
Triage first grade on the card, verbatim: "Guard departure the way the Access pillar and the Interfaces navigation already do (confirm plus
beforeunload), with one shared guard." A held edit lives only in the pillar's buffer, so before this change one stray click dropped a half-added field, step or widget that the strip had just promised was "kept here".Tests
Three new files, one per pillar, each through the real
StudioDesignSurfaceon the real route shape (the held edit is produced the way an author does it: a Picklist with no option, a Notify step with no Title, a Metric widget with no dataset):StudioDesignSurface.heldDataLeave-26705.test.tsx,StudioDesignSurface.heldFlowLeave-26705.test.tsx,StudioDesignSurface.heldWidgetLeave-26705.test.tsx, four cases each: leaving the pillar asks (Cancel keeps the held edit, OK leaves, and walking back asks nothing); the rail switch asks (Cancel keeps it, re-picking the open item asks nothing, OK opens the other item and the hold is gone); a reload asks only once the edit is held; and the CONTROL: with nothing held, the rail, the reload and the pillar link never ask.Runs
pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/ packages/app-shell/src/chrome/: 244 files, 1773/1773 passed, exit 0 (pre-merge headd2e66f47).origin/main: the three new files pluspillarNavGuard,heldPublish-11786,heldWidgetPublish-11910, re-run on the merge headb8d23d79: 6 files, 28/28 passed, exit 0.ResourceEditPage.discardDraftLabel-12690andPackageFormDialog.validationTiming, now load the zh studio catalogue at module scope (await loadStudioCatalogue('zh')), as other zh-reading suites do since the studio namespace became lazy (app-shell: a published library that is 66% Console product surface — retire the 67 zero-reference exports now, decide the split, and fold the second i18n table into @object-ui/i18n #25922). The first went red onTest UIat0a856a7d. With the zh catalogue held back 4 s, each is red without its preload (1/3, 3/5) and green with it (3/3, 5/5).pnpm --filter @object-ui/app-shell type-check: exit 0.Ablation (one-shot, through scripts/ablation-replace.mjs; each leg restored to the HEAD blob with an empty git diff HEAD)
unsavedPillarWork = pillarDirty): 6 of 12 red, exactly the leave and reload cases of all three pillars; the rail and control cases stay green.objHeld !== null/flowHeld !== null/leafHeld !== nullwithfalse): each pillar's rail-switch case red (1 of 4 per file), nothing else.Acceptance notes
?surface=request from the pending-changes sheet opens the requested item without asking. Both drop the held edit the same way a rail switch did. The card names leaving the pillar, the rail switch and reload; these two are left for a follow-up if wanted.@object-ui/app-shellisprivate: true, so no changeset.Verification
Gates derived by
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 24 families, all run, reconciled with--ran(24 run, 0 NOT-MEASURED).pnpm --dir ui exec vitest run scripts/reported one timeout incheck-vi-mock-inherit.test.ts(15 s, shared box under load) and passed 83/83 when that file was re-run alone.pnpm check:new-line-citations(ui): 0 new citations.Human Minimum
packages/specholds no runtime logic. (Not touched.)pnpm lintpasses. (eslint on the four files: 0 errors;StudioDesignSurface.tsxcarries the same 16 warnings as on the base, the three tests none.)main, one pull request.@object-ui/app-shellis private.)packages/spectouched: its generated artifacts are regenerated and committed. (Not touched.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code